#cs
	Autoit Test de mmo en tile
    Copyright (C) 2010 Jones

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>
#ce

#include-once

If _IrrGUIEventAvailable() then

        $pGUIEvent = _IrrReadGUIEvent()

		$gui_ID = __getGuiEvt($pGUIEvent, $EVT_GUI_IID)
		$gui_Event = __getGuiEvt($pGUIEvent, $EVT_GUI_IEVENT)

		Switch $gui_ID
		Case 101
		if $gui_Event = $EGET_EDITBOX_ENTER Then
			$chat_send = _IrrGUIGetText($chat_write)
			If $chat_send <> "" Then
			_send($socket,"CHAT|" & $chat_send)
			EndIf
			_IrrGUISetText($chat_write,"")
		EndIf

		EndSwitch
EndIf

If _IsPressed("25") Then
	left()
EndIf

If _IsPressed("27")	Then
	right()
EndIf

If _IsPressed("26") Then
	up()
EndIf

If _IsPressed("28") Then
	down()
EndIf

If _IsPressed("01") Then
	$mouse_pos = MouseGetPos()
	$monster_select = get_selected_monster($mouse_pos[0],$mouse_pos[1])
	If $monster_select[1] <> -1 Then
		atk_monster($monster_select[1])
	EndIf
	ConsoleWrite(time() & "pos : " & $monster_select[1] & @CRLF)
EndIf